﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Common;
namespace xx
{
	/// <summary>
    /// 
    /// </summary>
	public class Gun : MonoBehaviour {
        public GameObject bulletPrefab;
        public void Firing()
        {
            //Instantiate(bulletPrefab, transform.position, transform.rotation);
            GameObjectPool.Instance.CreateObject("bullet", bulletPrefab, transform.position, transform.rotation);
        }
        private void OnGUI()
        {
            if (GUILayout.Button("发射"))
            {
                Firing();
            }
            if (GUILayout.Button("清空key"))
            {
                GameObjectPool.Instance.Clear("bullet");
            }
            if (GUILayout.Button("清空所有"))
            {
                GameObjectPool.Instance.ClearAll();
            }
        }
    }
}

